package loan.calc.domain;

import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import io.swagger.v3.oas.annotations.media.Schema;
import loan.calc.constant.dict.rate.*;
import lombok.Data;
import lombok.EqualsAndHashCode;

import java.io.Serializable;
import java.math.BigDecimal;
import java.time.LocalDate;

@EqualsAndHashCode(callSuper = true)
@Data
@TableName("loan_rate_segment")
@Schema(description = "借据利率区段实体", name = "LoanRateSegmentDO", title = "借据利率区段")
public class LoanRateSegmentDO extends BaseEntity implements Serializable {

    /**
     * 主键id
     */
    @TableId
    @Schema(description = "借据利率区段编号")
    private Long rateSegmentId;

    /**
     * 借据id
     */
    @Schema(description = "借据编号")
    private Long loanId;

    /**
     * 利率类型（固定/浮动）
     */
    @Schema(description = "利率浮动模式: 固定利率、浮动利率")
    private RateFloatModeDictEnum rateMode;

    /**
     * 利率调整方式
     */
    @Schema(description = "利率调整方式")
    private RateUpdateTypeEnum rateRepriceType;

    /**
     * 下次调整日期
     */
    @Schema(description = "下次调整日期")
    private LocalDate repriceDate;

    /**
     * 区段生效日期
     */
    @Schema(description = "区段生效日期")
    private LocalDate startDate;

    /**
     * 区段失效日期
     */
    @Schema(description = "区段失效日期")
    private LocalDate maturityDate;

    /**
     * 利率类型（贷款利率/罚息利率/复利利率）
     */
    @Schema(description = "区段失效日期")
    private RateTypeEnum rateType;

    /**
     * 利率单位
     */
    @Schema(description = "利率单位")
    private RateUnitEnum rateUnit;

    /**
     * 基准利率类型
     */
    @Schema(description = "基准利率类型")
    private RateBaseTypeEnum baseRateType;

    /**
     * 基准利率
     */
    @Schema(description = "基准利率")
    private BigDecimal baseRate;

    /**
     * 执行利率基于基准利率上浮类型（按比例浮动/按浮动点浮动）
     */
    @Schema(description = "执行利率基于基准利率上浮类型（按比例浮动/按浮动点浮动）")
    private RateFloatTypeEnum rateFloatType;

    /**
     * 浮动幅度
     */
    @Schema(description = "浮动幅度")
    private BigDecimal rateFloat;

    /**
     * 执行利率
     */
    @Schema(description = "执行利率")
    private BigDecimal executionRate;

    /**
     * 年基准天数
     */
    @Schema(description = "年基准天数")
    private Integer yearBaseDay;

}
